package jgl.vajra.driver.part.splash;

import jgl.vajra.driver.R;
import jgl.vajra.driver.manager.IntentManager;
import jgl.vajra.driver.widget.base.BaseCommonActivity;
import jgl.vajra.driver.widget.retrofithelper.rxsubscriber.CommonObserver;
import jgl.vajra.driver.widget.utils.TimerUtils;

import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.ImmersionBar;


public class SplashActivity extends BaseCommonActivity {

    @Override
    public int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    public void initView() {
        super.initView();
        ImmersionBar.with(this).fullScreen(true).statusBarDarkFont(true, 0.2f).hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR).init();
        // timerObservable = new TimerObservable(this);
       /* if (SPManager.AgreementSplashData.getAgreementStatus()) {

        } else {
            AgreementSplashDialogFragment agreementSplashDialogFragment = new AgreementSplashDialogFragment();
            agreementSplashDialogFragment.show(getSupportFragmentManager());
        }*/

        TimerUtils.countdown(2).
                subscribe(new CommonObserver<Integer>() {
                    @Override
                    public void onComplete() {
                        super.onComplete();
                        IntentManager.toBaseWebViewActivity(SplashActivity.this,"");
                        finish();
                    }
                });

       /* IntentManager.toBaseWebViewActivity(this,"");
        finish();*/
    }

    @Override
    protected boolean isNeedLoadStatusBar() {
        return false;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onBackPressed() {

    }
}
